define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Productmanager_brand_agent,$ionicSlideBoxDelegate,GoPage) {
		 //滑动切换
		$scope.selectTab = 0;
		$scope.activeSlide = function(index) {
			$scope.selectTab = index;
			$ionicSlideBoxDelegate.$getByHandle('tab-handle').slide(index);
		};
		$scope.slideChanged = function(index) {
			$scope.selectTab = index;
		};
		
	    //跳转到品牌编辑页面
		$scope.onshow_productmanager_brand_agent_edit = function(){
			GoPage.go_states("productmanager_brand_agent_edit");
		}
		$scope.init_data = function(){
			Productmanager_brand.brand_list(function(data){
				$scope.datas = data;
			})
		}
		
		$scope.init_data = function(){
			Productmanager_brand_agent.brand_list(function(data){
				$scope.brand_lists = data.brand;
			})
		}
		$scope.init_data(); //必须在定义之后
		
	}

	controller.$inject = ['$scope', 'Productmanager_brand_agent','$ionicSlideBoxDelegate','GoPage'];
	
	return app.registerController("productmanager_brand_agentctrl",controller);
});